﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Service.Interface;
using Domain;
using Dao.Interface;

namespace Service
{
    public class UserInfoService : Service<UserInfo>, IUserInfoService
    {
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="name">用户名</param>
        /// <returns></returns>
        public UserInfo Get(string name)
        {
            return ((IUserInfoRepository)(this.CurrentRepository)).Get(name);
        }

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public UserInfo Get(string name, string password)
        {
            return ((IUserInfoRepository)(this.CurrentRepository)).Get(name, password);
        }

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="email">邮箱</param>
        /// <returns></returns>
        public UserInfo GetByEmail(string email)
        {
            return ((IUserInfoRepository)(this.CurrentRepository)).GetByEmail(email);
        }

        /// <summary>
        /// 根据用户手机号码获取用户信息
        /// </summary>
        /// <param name="mobile">手机号码</param>
        /// <returns></returns>
        public UserInfo GetByMobile(string mobile,string userPwd)
        {
            return ((IUserInfoRepository)(this.CurrentRepository)).GetByMobile(mobile,userPwd);
        }
    }
}
